USE ConsultTracking
GO
drop proc CreatePO
drop proc UpdatePO
GO
------------------------------------------------------------------
create proc CreatePO
@TaskID int,
@Description nvarchar(100),
@UserID int,
@Manufacturer nvarchar(60),
@ModelNumber nvarchar(30),
@Quantity int,
@Price decimal(8,2)
as
INSERT INTO [ConsultTracking].[dbo].[PurchaseOrder]
           ([TaskID]
           ,[Description]
		   ,[UserID]
           ,[Manufacturer]
           ,[ModelNumber]
           ,[Quantity]
           ,[Price])
     VALUES
           (@TaskID
           ,@Description
		   ,@UserID
           ,@Manufacturer
           ,@ModelNumber
           ,@Quantity
           ,@Price)
--------------------------------------------------------------
go
create proc UpdatePO
@PurchaseOrderID int,
@DescriptionID int,
@Manufacturer nvarchar(60),
@ModelNumber nvarchar(30),
@Quantity int,
@Price decimal(8,2)

as
UPDATE [ConsultTracking].[dbo].[PurchaseOrder]
   SET [Description] = @DescriptionID
      ,[Manufacturer] = @Manufacturer
      ,[ModelNumber] = @ModelNumber
      ,[Quantity] = @Quantity
      ,[Price] = @Price
 	  ,[Modified] = GETDATE()
WHERE PurchaseOrderID = @PurchaseOrderID